import request from '@/utils/request';

// 查询出库单列表
export function listShipmentOrder(query: Record<string, any>) {
  return request({
    url: '/wms/shipmentOrder/list',
    method: 'get',
    params: query
  })
}

// 查询出库单详细
export function getShipmentOrder(orderId: string | number) {
  return request({
    url: '/wms/shipmentOrder/' + orderId,
    method: 'get'
  })
}

// 新增出库单
export function addShipmentOrder(data: Record<string, any>) {
  return request({
    url: '/wms/shipmentOrder',
    method: 'post',
    data: data
  })
}

// 修改出库单
export function updateShipmentOrder(data: Record<string, any>) {
  return request({
    url: '/wms/shipmentOrder',
    method: 'put',
    data: data
  })
}

// 删除出库单
export function delShipmentOrder(orderId: string | number | string[]) {
  const ids = Array.isArray(orderId) ? orderId.join(',') : orderId;
  return request({
    url: '/wms/shipmentOrder/' + ids,
    method: 'delete'
  })
}

// 导出出库单
export function exportShipmentOrder(query: Record<string, any>) {
  return request({
    url: '/wms/shipmentOrder/export',
    method: 'post',
    data: query
  })
}

// 出库单审核
export function auditShipmentOrder(orderId: string | number, status: number) {
  return request({
    url: '/wms/shipmentOrder/audit',
    method: 'put',
    data: { orderId, status }
  })
}

// 出库单出库
export function shipmentShipmentOrder(orderId: string | number) {
  return request({
    url: '/wms/shipmentOrder/shipment/' + orderId,
    method: 'put'
  })
}




